/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pojo;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author pvhuy
 */
@Entity
@Table(name=TheLoai.TABLE_THELOAI)
public class TheLoai extends Base {
    public static final String TABLE_THELOAI = "TheLoai";

    protected static final String COLUMN_TENTHELOAI = "TenTheLoai";
    private static final int LENGTH_TENTHELOAI = 45;
    @Column(name=COLUMN_TENTHELOAI, length=LENGTH_TENTHELOAI, nullable=false)
    private String tenTheLoai;

    protected static final String COLUMN_NHOMSANPHAM = "MaNhomSanPham";
    @ManyToOne(cascade=CascadeType.ALL)
    @JoinColumn(name=COLUMN_NHOMSANPHAM)
    private NhomSanPham nhomSanPham;

    /**
     * @return the tenTheLoai
     */
    public String getTenTheLoai() {
        return tenTheLoai;
    }

    /**
     * @param tenTheLoai the tenTheLoai to set
     */
    public void setTenTheLoai(String tenTheLoai) {
        this.tenTheLoai = tenTheLoai;
    }

    /**
     * @return the nhomSanPham
     */
    public NhomSanPham getNhomSanPham() {
        return nhomSanPham;
    }

    /**
     * @param nhomSanPham the nhomSanPham to set
     */
    public void setNhomSanPham(NhomSanPham nhomSanPham) {
        this.nhomSanPham = nhomSanPham;
    }
}
